package com.lovo.system.service.impl;

import com.lovo.common.model.CutPageBean;
import com.lovo.common.model.EmpBean;
import com.lovo.common.model.LogBean;
import com.lovo.system.dao.ILogDao;
import com.lovo.system.dao.impl.LogDaoImpl;
import com.lovo.system.service.ILogService;
/**
 * 日志管理的Service实现类
 * @author 白德柯
 *
 */
public class LogServiceImpl implements ILogService {
    private ILogDao logDao = new LogDaoImpl();
    @Override
    public CutPageBean<LogBean> findByItem(int page, String startDate, String endDate) {
        return logDao.findByItem(page,startDate,endDate);
    }

    @Override
    public int add(Object loginUser,String logInfo) {
        if(loginUser == null){
            return 0;
        }
        EmpBean empBean = (EmpBean)loginUser;

        return logDao.add("登录名："+empBean.getLoginName()+"，姓名："+empBean.getName()+"，" + logInfo);
    }
}
